home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / pcpil / pidoc6.txt < prev    next >
Text File  |  1994-02-28  |  34KB  |  726 lines

  1. Chapter 9. PILOT TUTORIAL
  2.  
  3. To make best use of this chapter you should read it with the computer close 
  4. at hand in order to work through the examples as you go along. Examples 
  5. assume that you have a copy of your PILOT distribution disk mounted in the 
  6. current default disk drive or directory. As you work through this tutorial it 
  7. is a good idea to go back and read the applicable reference sections of the 
  8. manual. It will help fill in details left out here and will familiarize you 
  9. with that manual.  
  10.  
  11. Various other materials that may be helpful in learning PILOT are listed in 
  12. Appendix C. They include books and on-line tutorial programs on PILOT 
  13. programming and related topics. 
  14.  
  15. INTRODUCTION 
  16.  
  17. Computer assisted instruction (CAI) is a general term which refers to the 
  18. process of using an interactive computer to deliver educational material to a 
  19. person.  In general it is done something like this: first, the author 
  20. (program writer) creates a program. The program is sometimes referred to as a 
  21. lesson or as courseware. The student then runs the program on the computer, 
  22. and through interaction with the program the student is led through the 
  23. lesson.  Normally, many students run the program once it is written. The 
  24. process is analogous to writing a book, in that much work is put into the 
  25. original which is used many times.  
  26.  
  27. How effective is the whole process? It depends on several factors: the 
  28. author's mastery of the subject matter, the particular educational approach 
  29. used to present the material and the particular CAI system used to program 
  30. and deliver the lesson. That is where PILOT comes in; it has evolved over a 
  31. period of about 12 years to fit this type of programming very well.  
  32.  
  33. Though the author is completely free to use any combination of presentation 
  34. techniques, there are a few types of CAI which can be labeled and described 
  35. here as examples. The simplest form of CAI is drill and practice. This method 
  36. presents problems or questions to the student. Often the problems have a 
  37. randomly generated component. The amount of feedback and assistance given on 
  38. wrong answers varies. A second typical use is testing. This can be similar to 
  39. drill and practice in that a series of questions is presented; the difference 
  40. is that the primary purpose is to evaluate and record the student's 
  41. performance. Either of the above methods may take the form of multiple 
  42. choice, fill in the blank, or verbal reply. These two methods are also the 
  43. easiest type of program to write for the beginner. PILOT provides easy 
  44. commands to present text and/or graphics, accept replies, evaluate replies, 
  45. give feedback and decide what to do next.  
  46.  
  47. A third type of CAI lesson is the tutorial. This consists of an ongoing 
  48. conversation between the program and the student.  (note: The computer is 
  49. only the medium over which the two parties in the conversation communicate, 
  50. it is not one of the parties in the conversation.) The conversation can 
  51. consist of displays of text and graphics, replies or inputs by the student, 
  52. and further actions by the program based on student replies. This method is 
  53. very useful to show the student how something works then to check the 
  54. student's understanding and dynamically adjust the presentation to the 
  55. student. This method implies that the author can predict in advance the  
  56. possible errors and areas of misunderstanding that the student may have, so 
  57. as to determine what should happen in each case. A good tutorial program 
  58. implements individualized instruction for each student who runs the program. 
  59. Often such a program is improved as it is tested on many students and 
  60. adjusted to handle previously unanticipated problems.  
  61.  
  62. The final type of CAI mentioned here is simulation.  This consists of the 
  63. program setting up an environment similar to a particular situation so that 
  64. the student can learn something about the situation.  There are many 
  65. interesting possibilities here. A few examples will give you the idea. A CAI 
  66. lesson could teach the use of another software package, such as a word 
  67. processor or database, by leading the student through displays and responses 
  68. that look like those that the package uses. In this way the responses given 
  69. can be checked and appropriate explanations made. Another simulation might 
  70. allow the student to perform laboratory experiments in a simulated lab rather 
  71. than in a real one. The student can practice operating a device or machine in 
  72. a safe and inexpensive environment. Finally, there is the game program which 
  73. incorporates the lesson material into a competitive or entertaining form.  
  74.   
  75. A typical CAI lesson may use any combination of these forms or may 
  76. incorporate other forms. In fact there is much room for innovation in the 
  77. development of effective CAI. But no matter what material is presented or 
  78. what method is used, there are certain basic tools that are used repeatedly 
  79. in various combinations to build the lesson program. These tools are in the 
  80. form of PILOT commands or statements. Once you learn  how to use the various 
  81. statements, you can combine them in your own way to write the lesson you 
  82. want. This tutorial introduces you to the simple uses of some of the PILOT 
  83. statements. The Language Reference Manual contains complete details on all 
  84. PILOT features.  
  85.  
  86. As a final introductory note, before you would actually write any CAI program 
  87. you would spend considerable time on the selection of your material and on 
  88. the instructional design.  This, of course, depends on your own educational 
  89. philosophy and goals.  Since PILOT in and of itself does not impose any 
  90. particular instructional method, we will not spend time here suggesting 
  91. educational methods to be used.  
  92.  
  93. GETTING STARTED 
  94.  
  95. A PILOT program is made up of a series of commands or statements. There are 
  96. only about twenty different kinds of statements. Each one has a specific 
  97. purpose.  A statement is always written on one line of the screen. Each 
  98. statement starts with an op code; the op code identifies the particular type 
  99. of statement and consists of a letter. The op code is followed by a colon 
  100. (:), and then possibly text.  
  101.  
  102. The normal way to write a program is to use a text editor to create a disk 
  103. file. The disk file consists of the statements that make up the program. Once 
  104. the disk file is created you can tell PILOT to run the program. We will talk 
  105. more later about the process of creating the program file on disk.  
  106.  
  107. To get started we will run an already written PILOT program called SAMPLE1 
  108. which is supplied on your PILOT disk. It will allow us to try out one 
  109. statement at a time without having to write it first into a disk file. To get 
  110. started type the command: 
  111.  
  112.        PI SAMPLE1 
  113.  
  114. and push the return key. You can now write your first PILOT statement. Type 
  115. in the line: 
  116.  
  117.        T:Hello world!  
  118.  
  119. after you push return you should see: 
  120.  
  121.        Hello world!  
  122.  
  123. This is an example of a TYPE statement. The T is called the op code. Notice 
  124. that after the op code you put a colon and after the colon you put the text 
  125. which was to be displayed by the type statement. Try putting in another type 
  126. statement for practice. By experimenting, see what happens if you type the T 
  127. op code in lower case or leave off the colon after the op code.  
  128.  
  129. You should have noticed that it does not matter whether the op code is upper 
  130. or lower case. You should also have seen that leaving off the colon character 
  131. after the op code is considered an error by PILOT. In that case PILOT shows 
  132. you the statement it considers in error, followed by a message that tells 
  133. what it considers to be wrong.  Usually it will be easy for you to tell what 
  134. is wrong, but if you need more explanation check the ERROR MESSAGES section 
  135. of the Reference Manual. After any error in a program you can choose to stop 
  136. the program by pushing ctrl-C (that is holding down the ctrl key while 
  137. pushing the C key), or you can push any other key to continue on with the 
  138. execution of the program.  
  139.  
  140. TRYING OUT GRAPHICS 
  141.  
  142. If you do not have a color adapter on your computer, skip this section, as 
  143. you can not do graphics on a monochrome adapter.  
  144.  
  145. If you are not still running the SAMPLE1 program get it started by typing: 
  146.  
  147.        PI SAMPLE1 
  148.  
  149. Next you can try out the GRAPHICS statement. To do so you must first select a 
  150. screen mode which allows graphics. Also for convenience you can establish a 
  151. text viewport at the bottom of the screen to keep the things you type 
  152. isolated from the graphics you draw.  To do this type: 
  153.  
  154.        TS:M4;V0,39,20,24 
  155.  
  156. and push return. The TS op code is used for several purposes; what you did 
  157. here was to set screen mode 4, and make the last 5 lines of the screen the 
  158. text viewport. You should have a blank screen now and the cursor should be 
  159. toward the bottom of the screen.  
  160.  
  161. To draw graphics you tell an invisible turtle which direction to turn and how 
  162. many steps to take. As the turtle moves it can draw a line of some chosen 
  163. color.  When a program starts, the turtle is in the middle of the screen and 
  164. is pointed towards the top of the screen. Try the following statement which 
  165. tells the turtle to go forward 100 steps:  
  166.  
  167.        G:F100 
  168.  
  169. You should see a vertical line appear. Now tell the turtle to turn to its 
  170. right and go forward another 100 steps:  
  171.  
  172.        G:R90;F100 
  173.  
  174. You should see a horizontal line appear making a right angle with the 
  175. vertical line. In both the above statements the G is the op code for the 
  176. GRAPHICS statement. The F100 is a forward command for 100 steps. The R90 says 
  177. turn right 90 degrees. You can put any number of commands after the colon as 
  178. long as each is separated from the next one by a semi-colon.  Try this 
  179. statement; it completes the drawing of a box:  
  180.  
  181.        G:R90;F100;R90;F100 
  182.  
  183. To change the color of the lines drawn by the turtle type: 
  184.  
  185.        G:C1 
  186.  
  187. This command sets the line color to color number 1.  See the GRAPHICS section 
  188. of the Reference Manual for information about the various colors available. 
  189. Try drawing a box in the new color: 
  190.  
  191.        G:F200;R90;F200;R90;F200;R90;F200 
  192.  
  193. Notice that in the above statement the same sequence is repeated several 
  194. times. There is a short hand way of representing this on the GRAPHICS 
  195. statement. Try the following statement, it is equivalent to the last one:  
  196.  
  197.        G:*4(F150;R90) 
  198.  
  199. The notation *n(...) allows you to repeat the commands in the parentheses n 
  200. times. This turns out to be a very powerful feature, as you will see by 
  201. trying out the following statements. Two new commands are used below. The E 
  202. command on the GRAPHICS statement causes the screen to be erased. The L 
  203. command tells the turtle to turn left.  Try each of these statements:  
  204.  
  205.        G:E;*3(F350;R120) 
  206.  
  207.        G:E;*5(F240;R72) 
  208.  
  209.        G:E;*8(F200;L45) 
  210.  
  211.        G:E;*20(F30;L18) 
  212.  
  213.        G:*5(F300;R144) 
  214.  
  215.        G:E;C2;*72(F400;R175) 
  216.  
  217. There are a few other important facts to know about the GRAPHICS statement. 
  218. One is illustrated by the following example. Try it to see what happens.  
  219.  
  220.        G:E;H80;*200(F5) 
  221.  
  222. You should see the line run off the right side of the screen and come back on 
  223. the left side. In general any time you draw off one edge of the screen you 
  224. come back on the opposite edge.  This wrap around feature of the screen makes 
  225. it act as if it were infinite in all directions.  
  226.  
  227. There are 320 individual pixels (dots) across the screen. They are numbered 
  228. from 0 on the left to 319 on the right. There are 200 pixels from top to 
  229. bottom; they are numbered from 0 on the top to 199 on the bottom. You can 
  230. tell the turtle to go to any particular pixel by giving the horizontal (x co-
  231. ordinate) and the vertical (y co-ordinate) positions.Try these statements for 
  232. an example.  
  233.  
  234.        G:G20,15;F30 
  235.  
  236.        G:G300,100;F25 
  237.  
  238. Normally one step for the turtle is one quarter of a pixel.  That means that 
  239. it would have to go at least four steps to make a line two pixels long.You 
  240. can control the horizontal and vertical scale factors to set the size of one 
  241. turtle step. Try the following three statements. They show the effect of the 
  242. scale factors.  
  243.  
  244.        G:E;G130,100 
  245.  
  246.        G:*3(F40;R120) 
  247.  
  248.        G:X4;Y4;*3(F40;R120) 
  249.  
  250. Notice that the same triangle is drawn but it is four times as large the 
  251. second time. The reason is that the X and Y scaling factors are each set to 
  252. 4. At this setting one turtle step is equal to one pixel on the screen.  
  253.  
  254. There are several uses of the scale factors. One is to compensate for a 
  255. display screen which has pixels that are not square. For example, when 
  256. drawing what should be a square and it is a little wider than it is tall, you 
  257. can adjust it by setting the X scale to 3 and the Y scale to 4. A second use 
  258. of the scale factors is to purposely distort a figure.  For example, the 
  259. following statement draws what would normally be a circle, but by setting the 
  260. scale factors it draws an ellipse instead.  
  261.  
  262.        G:E;X3;Y1;*20(F20;R18) 
  263.  
  264. At this point you should read the GRAPHICS statement section of the Reference 
  265. Manual. After having tried these few examples it will make more sense to you 
  266. than it may have before. You will also notice that there are features 
  267. described there that were not covered here.  
  268.  
  269. Before you go on to the next section you can clean up the screen by entering: 
  270.  
  271.        TS:M0 
  272.  
  273. which puts the screen back into text mode 0.  
  274.  
  275.  
  276. THE USE OF VARIABLES 
  277.  
  278. If you are not already running the SAMPLE1 program then start it by entering: 
  279.  
  280.        PI SAMPLE1 
  281.  
  282. A variable is a word which names a storage location in computer memory. PILOT 
  283. has two kinds of variables. The first is a numeric variable which, as you may 
  284. guess, stores a number. The COMPUTE statement is used to save the result of a 
  285. computation in a numeric variable. Try for example: 
  286.  
  287.        C:X=3+4 
  288.  
  289. To understand what this statement does you might read it as "save the sum of 
  290. 3 and 4 in the variable X".  You can display the value of a variable thus: 
  291.  
  292.        T: #X 
  293.  
  294. You should see 7 displayed. Notice that the # itself is not displayed, 
  295. neither is the X. The # character tells the TYPE statement that a numeric 
  296. variable follows and that the value of the variable, not the name of the 
  297. variable, is to be displayed. Numeric variables have many uses, such as 
  298. counting the number of correct and incorrect answers. We have used the 
  299. variable name X, but you may choose any letter or word that will help you 
  300. remember what purpose the variable is to serve.  Try these three statements, 
  301. which might be found in different parts of a program.  
  302.  
  303.        C: WRONG = 0 
  304.        C: WRONG = WRONG + 1 
  305.        T:You had #WRONG incorrect answer(s).  
  306.  
  307. In this case the variable is named WRONG. As a side note, the examples show 
  308. variable names in upper case only; in practice you can use upper or lower 
  309. case interchangeably in variable names.  That is, the variable name SCORE 
  310. refers to the same value as the variable name score.  
  311.  
  312. A second type of variable is the character string, or just string. It can be 
  313. used to save a list of characters, such as a person's name.  There are two 
  314. important facts about a string variable. First, the name of a string variable 
  315. always has a $ on the end of it. Second, you have to use the DIMENSION 
  316. statement to set aside memory space for the string before you can use it. Try 
  317. the following statement.  It defines a string variable called NAME$, and sets 
  318. aside enough memory to store up to 10 characters.  
  319.  
  320.        D: NAME$(10) 
  321.  
  322. The compute statement can be used to set a string variable in much the same 
  323. manner as a numeric variable. Try these two statements.  
  324.  
  325.        C: NAME$ = "Mickey Mouse" T:I like $NAME$.  
  326.  
  327. If you did it exactly as shown, then you would see the line: 
  328.  
  329.        I like Mickey mou.  
  330.  
  331. NAME$ was set up to hold 10 characters, therefore, only the first 10 
  332. characters were saved.  Why are there two $ characters, one before and one 
  333. after the variable? The first $ indicates to the TYPE statement that a string 
  334. variable name follows and that the value of the string variable is to be 
  335. displayed. The second $ is actually part of the variable NAME$. It would be 
  336. helpful at this point to read the sections of the Reference Manual on the 
  337. COMPUTE and DIMENSION statements, and VARIABLES and EXPRESSIONS.  
  338.  
  339. A FIRST PROGRAM 
  340.  
  341. If you are still running SAMPLE1, stop it by pushing ctrl-C.  
  342.  
  343. To write a program you must create a text file with a name that ends in .PIL 
  344. ; for this example you should use the name FIRST.PIL. The EZ editor that 
  345. comes with PILOT makes this process very simple. (If, however, you already 
  346. have a text editor you would rather use, go ahead it does not matter how the 
  347. program gets into the text file.) EZ is described more completely in the 
  348. Reference Manual. Please use EZ to get you started this time, type: 
  349.  
  350.        EZ FIRST.PIL 
  351.  
  352. You will see a line that says new file, then the screen will go blank. Start 
  353. typing the lines you wish. After each line, push return. If you make an 
  354. error, use the backspace or arrow keys to move to the spot in error, then 
  355. type the correction over the error. When you are done push the F10 key. Try 
  356. entering the following simple PILOT program.  
  357.  
  358.        D:NAME$(10) 
  359.        T:Hello, what is your name?  
  360.        A:$NAME$ 
  361.        T:Hi $NAME$, nice to meet you!  
  362.  
  363. Once you have typed it in, save it by pushing the f10 key. Next try running 
  364. the program by typing: 
  365.  
  366.        PI FIRST 
  367.  
  368. The first statement sets up a string variable called NAME$ and reserves 10 
  369. characters of memory for it.  The second statement types out the message 
  370. Hello etc, which is the first thing you should see on the screen. The next 
  371. line contains an ACCEPT ANSWER statement signified by the A op code. It tells 
  372. PILOT to allow the student to enter a response.  Nothing further happens 
  373. until the student types something and pushes the return key. Assuming the 
  374. student types a name, e.g. Mary. The next TYPE statement displays the message 
  375. "Hi Mary, nice to meet you!" 
  376.  
  377. If the program does not run as you expect it to, use the editor to correct 
  378. the program and try it again.  To edit the program with EZ enter: 
  379.  
  380.        EZ FIRST.PIL 
  381.  
  382. exactly as you did when creating the program.  You will see your program on 
  383. the screen. Move the cursor to the spot you need to fix using the arrow keys.  
  384. Then type the corrections over the errors.  
  385.  
  386. You should try running the program a few times with different responses. See 
  387. what happens if you enter a very long name or no name at all.  
  388.  
  389. Also, if you are using EZ you should now read the section in the Reference 
  390. Manual which describes it.  Try out each command or function key to make sure 
  391. you understand how it is used.  
  392.  
  393.  
  394. A SIMPLE QUESTION FRAME 
  395.  
  396. One of the things often done in a CAI program is to ask a question (possibly 
  397. accompanied by some explanatory text or graphics), and then accept an answer 
  398. from the student. Next the student answer is judged and an appropriate 
  399. feedback message is given.  If the answer is incorrect then the student is 
  400. given another try. If the answer is correct then the program proceeds to the 
  401. next question. Sometimes one question in a program along with its explanatory 
  402. text, feedback messages, etc is called a FRAME or a PROBLEM. These terms are 
  403. used loosely but generally refer to what the student sees on the screen at 
  404. one time. The reason it is useful to think in these terms is that as the 
  405. interaction between the program and the student becomes more complex there 
  406. may be several exchanges or responses on the same question frame.  In this 
  407. case you have to plan ahead as to the placement of question, graphics, answer 
  408. and feedback on the screen, so as to keep things clear for the student. The 
  409. best way to illustrate how things are done with PILOT is by example.  
  410.  
  411. Below are some example programs of varying complexity.  Each one illustrates 
  412. the use of various PILOT statements in combination with others. Some 
  413. explanatory notes follow each program to point out some of the highlights, 
  414. but there will often be statements or features used without specific 
  415. explanation. You should study the program to see if you understand how it 
  416. works. Run each program several times trying various incorrect and correct 
  417. replies. This will help you understand how to plan for and handle anticipated 
  418. and unanticipated responses the student might give to a program.  
  419.  
  420. Enter this example as file name SECOND.PIL. It is a very basic (and 
  421. uninteresting) example of question and answer.  Once you have it entered, try 
  422. it out with various replies.  
  423.  
  424.        T:What color is the sky on a clear day?
  425.        A: 
  426.        M:BLUE!blue
  427.        TY:Right.
  428.        TN:No, try again.
  429.        JN:@A 
  430.  
  431. Notes on the above program: 
  432.  
  433. The first TYPE line asks a question. The ACCEPT statement allows the student 
  434. to enter an answer. The MATCH statement will result in a YES match if the 
  435. student answer contains the word blue, in either upper or lower case. In the 
  436. case of a YES match the feedback "Right." is displayed. In the case of a NO 
  437. match the feedback "No, try again." is displayed and the student is allowed 
  438. to answer again.  
  439.  
  440. The last statement of the program says to JUMP if the result of the last 
  441. MATCH was NO back to the last ACCEPT statement.  The effect is that the 
  442. student can answer again.  
  443.  
  444. The above example shows the essential elements of a question and answer 
  445. frame: the question is presented, an answer is accepted, it is judged for 
  446. correctness, and feedback is given for correct and incorrect replies. 
  447. However, in practice this program would be a bit boring to say the least. The 
  448. next program shows how to give the program a bit more personality.  
  449.  
  450. Enter this program as file name THIRD.PIL . It illustrates a simple question 
  451. frame. When typing in the program, notice that there are some blank lines 
  452. shown here between some of the statements.  They are only to make it easier 
  453. for you to see the various sections of the program. You do not need to put 
  454. the blank lines in the file. Also notice that there are several remark 
  455. statements in the program. They, of course, do not affect the operation of 
  456. the program at all, you can leave them out or change them as you wish.  
  457.  
  458.        R:simple question frame example 
  459.        PR:U 
  460.        D:N$(20) 
  461.        TH:What should I call you today ?  
  462.        A:$N$ 
  463.        T: 
  464.        :Alright $N$, let's get started.  
  465.        W:30 
  466.        TX:Sailing is a lot of fun.  
  467.        :But before we can talk much about it 
  468.        :we have to make sure we both know 
  469.        :the various terms used. For instance, 
  470.        :do you know what we call the back end 
  471.        :of the boat?  
  472.        A: 
  473.  
  474.        R:first check for correct answer.
  475.        M:STERN
  476.        TY:Right $N$, it is the stern.
  477.        JY:@P
  478.    
  479.        R:after 4 tries, give the answer
  480.        T4:I think I better just tell you,
  481.        :it is called the "stern".
  482.        J4:@P
  483.   
  484.        R:in case they answer just YES
  485.        M:YES!OF COURSE!EASY
  486.        TY:Good, what do we call it?
  487.        JY:@A
  488.  
  489.        R:check for anticipated errors
  490.        M:BOW
  491.        TY:Wrong end $N$, try again.
  492.        JY:@A
  493.  
  494.        M:AFT!REAR!PORT!STARB
  495.        TY:Good guess, but not the term I want.
  496.        :Try again.
  497.        JY:@A
  498.  
  499.        T1:I don't understand you.
  500.        T2:No, this term refers only to boats.
  501.        T3:I think you are just guessing.
  502.        T:Give it another try.
  503.        J:@A
  504.  
  505.        R:next problem starts here
  506.        PR:
  507.        W:30
  508.        TX:The next question would go here...
  509.        W:40
  510.        E:
  511.  
  512. Notes on the above program: 
  513.  
  514. The variable N$ is used to save the student's name so it can be included in 
  515. feedback messages.  
  516.  
  517. There are several groups of statements that are similar in that they consist 
  518. of a MATCH followed by a TYPE-if-YES, followed by a JUMP-if-YES. The MATCH 
  519. tests the answer given by the student by comparing it to the answer on the 
  520. MATCH statement itself. If the student answer contains the answer given on 
  521. the MATCH statement then the result is a YES match.  The Y conditional found 
  522. on the subsequent TYPE and JUMP statements causes the statement to be 
  523. executed only if the previous MATCH result was YES. Otherwise the statement 
  524. is skipped.  
  525.  
  526. The first PR statement sets the U option. This means that all student answers 
  527. are internally converted to upper case only. Note that in being consistent 
  528. with this, the answers on the various MATCH statements are coded in upper 
  529. case. The net effect of this combination is to ignore whether the student 
  530. answers in upper or lower case.  
  531.  
  532. To make the program interesting to the student, some incorrect answers have 
  533. been anticipated so that appropriate feedback messages will be given in these 
  534. instances. To a large extent, the skill of the CAI author in doing this 
  535. contributes to the quality of the resulting CAI lesson.  
  536.  
  537. The DIGIT CONDITIONAL , that is, the placement of a number after an op code, 
  538. is used in several places.  It causes the statement to be executed if it 
  539. equals the number of responses the student has given on this question. The 
  540. two uses shown are to give successive hints on the first, second and third 
  541. wrong tries, and to finally give the answer to the student on the fourth 
  542. wrong try.  
  543.  
  544. There are two JUMP destinations used, namely back to the ACCEPT to let the 
  545. student try again or forward to the next PROBLEM when it is time to go on.  
  546. MORE ABOUT THE MATCH STATEMENT 
  547.  
  548. The MATCH statement is one of PILOT's most unique and powerful features. It 
  549. is used to judge the last student answer against a pattern.  The end result 
  550. of the MATCH statement is simply a YES (the student answer does fit the 
  551. pattern) or NO (the student answer does not fit the pattern). The YES or NO 
  552. result can be used to conditionally execute or skip over any statement by 
  553. appending a Y or N to the op code.  As you have already seen, the statement: 
  554.  
  555.        TY:That is right.  
  556.  
  557. would be executed only if the previous MATCH statement resulted in a YES. 
  558. Otherwise it would be skipped. Conversely, the statement: 
  559.  
  560.        TN:That is wrong.
  561.  
  562. is executed only if the previous MATCH statement resulted in a NO. Otherwise 
  563. it is skipped.  
  564.  
  565. You have considerable latitude in coding the match pattern. First of all, the 
  566. student answer does not have to match the pattern exactly, it need only 
  567. contain the pattern somewhere within.  That is, the statement M:AUTO would 
  568. give a YES for the responses AUTOMOBILE or SEMI-AUTOMATIC. In each case, the 
  569. pattern AUTO is contained within the response.  
  570.  
  571. You need to consider the distinction between upper and lower case. If you 
  572. wish to treat answers in either case as equivalent, use the P op code to set 
  573. the U option. This forces all student input to upper case when it is stored 
  574. in the internal answer buffer.  This scheme works equally well with the L 
  575. (lower case) option. The S option causes the removal of all spaces from the 
  576. student answer. Match patterns must be coded according to the options set on 
  577. the P statement.  
  578.  
  579. There are several ways you can enhance the match pattern to allow for 
  580. variations in the student answer. It is very important to do so in order to 
  581. avoid unnecessary frustration on the part of a student who gives an 
  582. essentially correct reply which happens to vary slightly from the expected 
  583. reply.  There are two wild card characters you can use, the "*" and the "&". 
  584. The "*" matches any single character in the same position of the answer. For 
  585. example: 
  586.  
  587.        M:OL*MPIC would match OLYMPIC or OLIMPIC.
  588.  
  589. The & matches any string of zero or more characters. For example M:RED&BLUE 
  590. matchs RED AND BLUE or REDBLUE. "&" means "and". So the statement would mean 
  591. that "RED" and "BLUE" must be present in the given order.  
  592.  
  593. Often you wish to allow several alternative replies.  The ! can be used to 
  594. separate several possibilities.  "!" is often thought of as meaning or.  For 
  595. example: 
  596.  
  597.        M:boat!ship
  598.  
  599. would match either "boat" or "ship".  
  600.  
  601. The "*", "&" and "!" can be used in any combination within a match statement 
  602. to give flexible answer checking. For example: 
  603.  
  604.        M:cat&dog!be*r!lion 
  605.  
  606. would give a YES for "cats and dogs", "grizzly bears", "cold beer" or "lions 
  607. and tigers".  Sometimes the match is a little too flexible.  Consider the 
  608. statement M:no which obviously expects a negative answer. If the student were 
  609. to reply "I don't know", it would match since the answer contains "no". In 
  610. cases where the match needs to be restricted you can use the "%" character. 
  611. It matches only with a space or the start or the end of the student answer. 
  612. Some examples will clarify.  
  613.  
  614.        M:%no%
  615.  
  616. would match "no", but not "I don't know" because the first % says the word 
  617. must not be preceded by a non blank character and the second % says the word 
  618. must not be followed by a non-blank character.  
  619.  
  620.        M:*ed%
  621.  
  622. requires a word that ends in "ed" since * matches any character and % 
  623. requires that if anything follows "ed" it must be a space.  
  624.  
  625. The MATCH statement can be told to forgive minor spelling errors by appending 
  626. the S modifier to the M op code. This will allow a YES match even when the 
  627. student response differs slightly from the pattern.  You can ignore mistakes 
  628. made by the student without deciding ahead of time what mistakes might be 
  629. made.  For example: 
  630.  
  631.        MS:PILOT
  632.  
  633. would match "PILOT", "PILIT", "PILATE" or "PYLOT".  
  634.  
  635. You can use the following program to experiment with various MATCH 
  636. statements. Use it to try the features of the MATCH.  
  637.  
  638.        T:Input a reply or ctrl-C to quit.
  639.        A:
  640.        M: (put whatever you want here) 
  641.        TY:That matches.  
  642.        TN:That does not match.  
  643.        J:@A 
  644.  
  645. DISPLAY MODES AND FEATURES
  646.  
  647. With PILOT you can use the screen in several different modes. The display 
  648. mode determines how many character rows and columns there are on the screen, 
  649. what colors appear and whether there may be graphics displayed along with 
  650. text.  
  651.  
  652. The actual colors and display quality you see depend on the display adapter 
  653. you have (color or monochrome) and the monitor you have. In decreasing order 
  654. of display quality, the types of display you can have are: RGB color monitor, 
  655. composite video monitor and TV set (connected via an RF modulator). In 
  656. general, the documentation here applies only to systems with a color adapter 
  657. card. Graphics and color statements will not work with a monochrome adapter.  
  658.  
  659. The TYPE SCREEN (TS) statement is used to set the desired screen mode. For 
  660. example: 
  661.  
  662.        TS:M4
  663.  
  664. Sets screen display mode 4.  
  665.  
  666. When a program begins, the mode is set to mode 0. The modes are numbered from 
  667. 0 through 6. Modes 4, 5 and 6 allow the use of graphics and user-defined 
  668. characters. In the other modes the standard character set is always used.  
  669.  
  670. The TYPE SCREEN statement allows you to put text anywhere on the screen. The 
  671. screen always has 25 lines of text available, the top line is considered line 
  672. 0, the bottom line is considered line 24.  Depending on the display mode 
  673. there may be either 40 or 80 characters across each line.  The leftmost 
  674. column is considered 0, the rightmost is either 39 or 79. In placing text on 
  675. the screen you specify a character position as two numbers. The first number 
  676. is the column number, the second is the line (row) number.  
  677.  
  678. Column and line numbers are used in two ways.  First, you can define what is 
  679. called a VIEWPORT on the screen. A viewport is a rectangular section of the 
  680. screen in which text can be displayed. When a program starts out, the 
  681. viewport is considered to be the entire display screen. You can set the 
  682. viewport via 
  683.  
  684.        TS:V0,39,15,24
  685.  
  686. which sets the viewport to be from column 0 on the left, through column 39 on 
  687. the right and from line 15 on the top through line 24 on the bottom. In a 
  688. mode with 40 columns this would make the viewport equal to the bottom 10 
  689. lines of the screen. When a viewport is set in this way, the cursor is placed 
  690. at the home position (upper left corner of the viewport). Any text output 
  691. would display from that point on and text will be displayed only within those 
  692. bounds. If the viewport becomes full it scrolls up one line to accommodate 
  693. the next line of text. In doing so, all display data outside the text window 
  694. is left unaltered. You can change the viewport as often as you wish; this 
  695. facilitates the use of various parts of the screen to display certain data. 
  696. Each time a new viewport is set up, PILOT remembers what the previous one 
  697. was.  You can get back to the previous viewport by the statement: 
  698.  
  699.        TS:V;
  700.  
  701. which sets the viewport and the cursor position in the viewport to its 
  702. previous setting. To see how a viewport works try this program.  
  703.  
  704.        T:This text is outside the viewport.  
  705.        T:It will be unaffected by what 
  706.        T:happens in the viewport.  
  707.        TS:V10,30,11,16 
  708.        T:This text is inside the viewport.  
  709.        T:Type something 
  710.        T:and I will type 
  711.        T:it back.  
  712.        A: 
  713.        E5: 
  714.        T:#%B 
  715.        J:@A 
  716.  
  717. You can position the cursor anywhere within the current viewport by a 
  718. statement similar to: 
  719.  
  720.        TS:G5,6
  721.  
  722. which tells the cursor to go to column 5 and row 6 of the viewport. Remember, 
  723. column and row numbering starts at zero. If you specify a row or column too 
  724. large for the viewport then the cursor is set as close as possible to the 
  725. specified position while still remaining in the viewport.  
  726.